Two perf fixes#45
Merged
Merged
Conversation
… /pods The list_pods_unified handler was creating 2N Docker connections and doing 2N inspect_container calls for N running pods: one set from get_pod_api_port (via fetch_agent_status_for_pod) and another from get_pod_forwarded_ports, both inspecting the same container. Replace these with a single shared bollard::Docker connection (wrapped in Arc for the spawned tasks) and a new inspect_pod_ports() function that does one inspect_container call per pod and extracts both the pod-api host port and forwarded ports from the result. This halves the number of Docker socket round-trips per /pods request and eliminates repeated connection setup overhead. Assisted-by: OpenCode (Claude Opus 4)
When the /pods endpoint is slow (e.g. with many running pods), the fixed 5-second setInterval fires before the previous request returns, causing multiple concurrent requests to stack up. Replace setInterval with setTimeout loops that only schedule the next poll after the current one completes. This makes request pileup structurally impossible rather than relying on a runtime guard. The same pattern is applied to all three pollers (pods, launches, proposals) in the SolidJS context and to the agent-wrapper.js pod list poll. A disposed flag prevents stale polls after cleanup. Assisted-by: OpenCode (Claude Opus 4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.